package com.doctcloud.hisinfo.histable.domain.comm;

import com.baomidou.mybatisplus.annotation.TableName;
import com.doctcloud.common.core.annotation.Excel;
import com.doctcloud.common.core.annotation.TableDesc;
import lombok.*;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;

import static com.doctcloud.common.core.utils.StringUtils.trim;

@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(of = {"toxiName"})
@ToString
@TableDesc("药品毒理分类字典")
public class DrugToxicPropertyDictDo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Excel(name = "序号")
    private Integer serialNo;
    @Excel(name = "毒理代码")
    @NotBlank(message = "毒理代码不得为空")
    private String toxiCode;
    @Excel(name = "毒理名称")
    @NotBlank(message = "毒理名称不得为空")
    private String toxiName;
    @Excel(name = "处方类型")
    private String prescCurtName;
    @Excel(name = "输入码")
    private String inputCode;
    @Data
    public static class primaryKey {
        private final String toxiName;
        public primaryKey(String toxiName) {
            this.toxiName = toxiName;
        }
    }

    public void setToxiCode(String toxiCode) {
        this.toxiCode = trim(toxiCode);
    }

    public void setToxiName(String toxiName) {
        this.toxiName = trim(toxiName);
    }

    public void setPrescCurtName(String prescCurtName) {
        this.prescCurtName = trim(prescCurtName);
    }

    public void setInputCode(String inputCode) {
        this.inputCode = trim(inputCode);
    }
}
